﻿<%
'Blog模版应用模块
'
'主要功能：将模版代码转换成相应的asp页面
'
'author: evan zhao
'

    if not userRightObj.canManage then
        response.write("您没有权限")
        response.End
    end if
    
    function getFileStart()
        getFileStart = "" &_
            "<!--"&"#include file=""../../inc/common.asp"" -->                         " & vbCrLf &_ 
            "<" & "%                                                               " & vbCrLf &_
            "  dim i, count,title_trim, user_name_trim, pageNo,display_content     " & vbCrLf &_
            "  dim blogItem, blogItems                                             " & vbCrLf &_
            "  dim  start_date_str, end_date_str, insert_time_str                  " & vbCrLf &_
            "  dim date_str, last_date_str                                         " & vbCrLf &_
            "  dim item, topItems                                                  " & vbCrLf &_
            "  dim comment, topComments                                            " & vbCrLf &_
            "  dim blogCat, blogCats                                               " & vbCrLf &_
            "  dim linkGroup, linkGroups                                           " & vbCrLf &_
            "  dim link, links, linkCount, linkIndex                               " & vbCrLf &_
            "  dim mlHost, hostedBlogs                                             " & vbCrLf &_
            "  pageNo = trim(request(""pageno""))                                  " & vbCrLf &_
            "  if pageNo<>"""" then                                                " & vbCrLf &_        
            "    pageNo = clng(pageNo)                                             " & vbCrLf &_
            "  else                                                                " & vbCrLf &_
            "    pageNo = 1                                                        " & vbCrLf &_
            "  end if                                                              " & vbCrLf &_
            "  if pageNo<1 then                                                    " & vbCrLf &_
            "    pageNo=1                                                          " & vbCrLf &_
            "  end if                                                              " & vbCrLf &_
            "                                               " & vbCrLf &_
            " dim content_id                                " & vbCrLf &_
            " content_id = trim(request(""content_id""))    " & vbCrLf &_
            " set blogItem = new BlogItemClass              " & vbCrLf &_
            " if content_id<>"""" then                       " & vbCrLf &_
            "   content_id=clng(content_id)                   " & vbCrLf &_
            "   blogItem.load(content_id)                    " & vbCrLf &_
            " end if                                                              " & vbCrLf &_
            "%" & ">     "    & vbCrLf                          
    end function
    
    function getFileEnd()
        getFileEnd = " " & vbCrLf &_
            "<!--"&"#include file=""../../inc/end.asp"" -->" & vbCrLf 
    end function 
    
    function getBlogTitle()
        getBlogTitle = "<" & "%=blogObj.blogTitle%" & ">" ' & "<" & "% if content_id<>""""  then %" & "> - <" & "%=blogItem.title %" & ">  <" & "% end if %" & "> "
    end function
    
    function getBlogDescription()
        getBlogDescription = "<" & "%=filterHTML(blogObj.blogDesc)%" & ">" 
    end function
    
    function getBlogURL()
        getBlogURL = "index.asp?blog_id=<" & "%=blogObj.blogId%" & ">" 
    end function
    
    function getBlogRSSURL()
        getBlogRSSURL = "rss.asp?blog_id=<" & "%=blogObj.blogId%" & ">" 
    end function
    
    function getBlogPhotoURL()
        getBlogPhotoURL = "<" & "%=blogObj.photoUrl%" & ">" 
    end function
    
    function getBlogPostStart()
        getBlogPostStart = "<"&"% if userRightObj.canPost then %"&">"
    end function
    
    
    function getBlogPostURL
        getBlogPostURL = "edit.asp?blog_id=<" & "%=blogObj.blogId%" & ">" & "&cat_id=<" & "%=blogCatObj.catId%" & ">"
    end function

    function getBlogPostEnd()
        getBlogPostEnd = "<"&"% end if %"&">"
    end function

    function getBlogOwnerFullName()
        getBlogOwnerFullName = "<" & "%=blogObj.blogOwnerName%" & ">"
    end function

    function getBlogCurrentCategoryStart()
        getBlogCurrentCategoryStart = "<" & "% if blogCatObj.catId<>"""" then %" & ">"
    end function
    
    function getBlogCurrentCategoryName()
        getBlogCurrentCategoryName = "<" & "%=blogCatObj.CatName%" & ">"
    end function
    
    function getBlogCurrentCategoryURL()
        getBlogCurrentCategoryURL = "index.asp?blog_id=<" & "%=blogCatObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">"
    end function
    
    function getBlogCurrentCategoryEnd()
        getBlogCurrentCategoryEnd = "<" & "% end if %" & ">"
    end function

    function getBloggerStart()
      getBloggerStart = "" &_  
        "<" & "%         " & vbCrLf &_
        "  call assertConnected()                                                                       " & vbCrLf &_
        "  blogItems = blogCatObj.getBlogItems(pageNo)                                                  " & vbCrLf &_
        "  if not isArray(blogItems) then                                                               " & vbCrLf &_
        "    response.write(""尚无文章"")                                                               " & vbCrLf &_
        "  else                                                                                         " & vbCrLf &_
        "    count = ubound(blogItems)                                                                  " & vbCrLf &_
        "    if count<1 then                                                                            " & vbCrLf &_
        "        response.write(""尚无文章"")                                                           " & vbCrLf &_
        "    else                                                                                       " & vbCrLf &_
        "        for i=0 to count-1                                                                     " & vbCrLf &_
        "          set blogItem = blogItems(i)                                                          " & vbCrLf &_
        "          if not isEmpty(blogItem.itemId) then                                                 " & vbCrLf &_
        "            start_date_str = FORMATDATETIME(blogItem.startDate, vbShortDate)                   " & vbCrLf &_
        "            end_date_str = FORMATDATETIME(blogItem.endDate, vbShortDate)                       " & vbCrLf &_
        "            insert_time_str = FORMATDATETIME(blogItem.insertTime, vbShortDate)                 " & vbCrLf &_
        "            if userRightObj.canReadItem(blogItem) then                                           " & vbCrLf &_
        "%" & ">"
    end function
    
    function getBlogItemIfShowDetailStart()
        getBlogItemIfShowDetailStart = ""&_
            "<" & "%         " & vbCrLf &_
            "                 if blogItem.showContent=1 then            " & vbCrLf &_
            "                    display_content = true                 " & vbCrLf &_
            "                 elseif blogItem.showContent=0 then        " & vbCrLf &_
            "                    display_content = false                " & vbCrLf &_
            "                 else                                      " & vbCrLf &_
            "                    display_content = blogObj.showContent  " & vbCrLf &_
            "                 end if                                    " & vbCrLf &_
            "                 if display_content=True then              " & vbCrLf &_
            "%" & ">"
    end function
    

    function getBlogItemIfShowDetailEnd()
        getBlogItemIfShowDetailEnd ="<" & "%                 end if %" & ">"
    end function

    function getBlogItemIfHideDetailStart()
        getBlogItemIfHideDetailStart = ""&_
            "<" & "%         " & vbCrLf &_
            "                 if blogItem.showContent=1 then            " & vbCrLf &_
            "                    display_content = true                 " & vbCrLf &_
            "                 elseif blogItem.showContent=0 then        " & vbCrLf &_
            "                    display_content = false                " & vbCrLf &_
            "                 else                                      " & vbCrLf &_
            "                    display_content = blogObj.showContent  " & vbCrLf &_
            "                 end if                                    " & vbCrLf &_
            "                 if display_content<>True then             " & vbCrLf &_
            "%" & ">"
    end function

    function getBlogItemIfHideDetailEnd()
        getBlogItemIfHideDetailEnd ="<" & "%                 end if %" & ">"
    end function

    function getBlogDateHeaderStart()
        getBlogDateHeaderStart = ""
    end function
    
    function getBlogDateHeaderDate()
        getBlogDateHeaderDate = "<" & "% " &_
            " if start_date_str = insert_time_str and end_date_str = insert_time_str then " & vbCrLf &_
            "     date_str = insert_time_str                                              " & vbCrLf &_
            " elseif  start_date_str =  end_date_str then                                 " & vbCrLf &_
            "     date_str = end_date_str                                                 " & vbCrLf &_
            " else                                                                        " & vbCrLf &_
            "     date_str = start_date_str & "" ~ "" & end_date_str                        " & vbCrLf &_
            " end if                                                                      " & vbCrLf &_
            " 'if date_str <> last_date_str then                                          " & vbCrLf &_
            "     response.write (date_str)                                               " & vbCrLf &_
            "     last_date_str = date_str                                                " & vbCrLf &_
            " 'end if                                                                     " & vbCrLf &_
            "%" & ">"                          
    end function
    
    function getBlogDateHeaderEnd()
        getBlogDateHeaderEnd = ""
    end function

    function getBlogItemTitleStart()
        getBlogItemTitleStart = ""
    end function

    function getBlogItemTitle()
        getBlogItemTitle = "<" & "%=blogItem.title%" & ">"
    end function

    function getBlogItemTitleEnd()
        getBlogItemTitleEnd = ""
    end function

    function getBlogItemExcerpt()    
        getBlogItemExcerpt = "<" & "%=blogItem.excerpt%" & ">"
    end function 

    function getBlogItemBody()
        getBlogItemBody = "<" & "% " &_
            " if blogItem.isSecret then                         " & vbCrLf &_
            "    response.write(""<div>--保密内容--</div>"")    " & vbCrLf &_
            " end if                                            " & vbCrLf &_
            " response.write(blogItem.detail)                   " & vbCrLf &_
            " %" & ">"
    end function
    
    function getBlogItemEditStart()
        getBlogItemEditStart = "<" & "% if userRightObj.canEditItem(blogItem) then %" & ">"
    end function
    
    function getBlogItemEditURL()
        getBlogItemEditURL = "edit.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&content_id=<"&"%=blogItem.itemId%"&">&pageno=<"&"%=pageNo%"&">"
    end function
    
    function getBlogItemEditEnd()
        getBlogItemEditEnd = "<" & "% end if  %" & ">" 
    end function

    function getBlogItemDeleteStart()
        getBlogItemDeleteStart = "<" & "% if userRightObj.canDeleteItem(blogItem)  then %" & ">" 
    end function
    
    function getBlogItemDeleteURL()
        getBlogItemDeleteURL= "delete.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&content_id=<"&"%=blogItem.itemId%"&">&pageno=<"&"%=pageNo%"&">"
    end function
    
    
    function getBlogItemDeleteEnd()
        getBlogItemDeleteEnd = "<" & "% end if  %" & ">" 
    end function
        
    function getBlogItemCommentStart()
        getBlogItemCommentStart = "<" & "% if userRightObj.canReplyItem(blogItem) or blogItem.replyCount>0 then %" & ">" 
        'getBlogItemCommentStart = ""
    end function
            
    function getBlogItemCommentURL()
        getBlogItemCommentURL = "detail.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&content_id=<"&"%=blogItem.itemId%"&">&pageno=<"&"%=pageNo%"&">#reply"
    end function
        
    function getBlogItemCommentCount()
        getBlogItemCommentCount = "<" & "%=blogItem.replyCount%" & ">" 
    end function

    function getBlogItemCommentEnd()
        getBlogItemCommentEnd = "<" & "% end if  %" & ">" 
        'getBlogItemCommentEnd = ""
    end function
    
    function getBlogItemTrackStart
        getBlogItemTrackStart = "<" & "% if not blogCatObj.isRSS and blogItem.trackCount>0 then %" & ">" 
    end function

    function getBlogItemTrackURL()
        getBlogItemTrackURL = "detail.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&content_id=<"&"%=blogItem.itemId%"&">&pageno=<"&"%=pageNo%"&">#trackback"
    end function
        
    function getBlogItemTrackCount()
        getBlogItemTrackCount = "<" & "%=blogItem.trackCount%" & ">" 
    end function
                
    function getBlogItemTrackEnd
        getBlogItemTrackEnd = "<" & "% end if  %" & ">" 
    end function

    function getBlogItemAuthor()
        getBlogItemAuthor = "<" & "%=blogItem.userName%" & ">" 
    end function
    
    function getBlogItemAuthorLink()
    	  getBlogItemAuthorLink = "" &_
          "<"&"% if not isEmpty(blogItem.userId) then %"&">" &_
					"user.asp?user_id=<" & "%=blogItem.userId%" & ">&blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&pageno=<" & "%=pageNo%" & ">" &_
					"<"&"% else %"&">#<"&"% end if %"&">"
    end function

    function getBlogItemAuthorNickname()
        getBlogItemAuthorNickname = "<" & "%=blogItem.userName%" & ">" 
    end function
    
    function getBlogItemAuthorEmail()
        getBlogItemAuthorEmail = "<" & "%=encodemail(blogItem.email)%" & ">" 
    end function
    
    function getBlogItemAuthorWebURL()
        getBlogItemAuthorWebURL = "<" & "%=blogItem.webUrl%" & ">" 
    end function
    
    function getBlogItemDateTime()
        'getBlogItemDateTime = "" &_
        '  "<"&"%                                                                         " & vbCrLf &_   
        '  "  if start_date_str = insert_time_str and end_date_str = insert_time_str then " & vbCrLf &_
        '  "      response.write FORMATDATETIME(blogItem.insertTime,vbShortTime)                   " & vbCrLf &_
        '  "  else                                                                        " & vbCrLf &_
        '  "      response.write blogItem.insertTime                                              " & vbCrLf &_
        '  "  end if                                                                      " & vbCrLf &_
        '  "%"&">"

        getBlogItemDateTime = "" &_
          "<"&"%                                                                         " & vbCrLf &_   
          "      response.write FORMATDATETIME(blogItem.insertTime,vbShortTime)          " & vbCrLf &_
          "%"&">"
    end function
    
    function getBlogItemNumber()
        getBlogItemNumber = "<" & "%=blogItem.itemId%" & ">" 
    end function
    
    function getBlogItemPermalinkURL()
        getBlogItemPermalinkURL = "detail.asp?blog_id=<"&"%=blogObj.blogId%"&">&content_id=<"&"%=blogItem.itemId%"&"><"&"% if blogCatObj.catId<>"""" then response.write ""&cat_id="" & blogCatObj.catId end if %"&"><"&"% if pageNo<>1 then response.write ""&pageno="" & pageNo end if %"&"> "
    end function
    
    function getBlogItemArchiveFileName()
        getBlogItemArchiveFileName = ""
        'todo
    end function
    
    function getBlogItemCategoryStart()
      getBlogItemCategoryStart = "" &_
        "<"&"% "  & vbCrLf &_
        "            if not isNull(blogItem.catId) and not isEmpty(blogItem.catId) and blogItem.catId<>"""" and blogItem.catId<>""null"" then " & vbCrLf &_
        "%"&">"
    end function
    
    function getBlogItemCategoryName()
        getBlogItemCategoryName = "<"&"%=blogItem.catName%"&">"
    end function
    
    function getBlogItemCategoryURL()
        getBlogItemCategoryURL = "index.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogItem.catId%"&">"
    end function

    function getBlogItemCategoryEnd()
      getBlogItemCategoryEnd = ""&_
        "<"&"%                      " & vbCrLf &_
        "            end if         " & vbCrLf &_
        "%"&">"
    end function
    
    function getBlogItemMoreStart()
        getBlogItemMoreStart = ""&_
        "<"&"%                      " & vbCrLf &_
        "            if not isNull(blogItem.more) and not isEmpty(blogItem.more) then         " & vbCrLf &_
        "%"&">"
    end function

    function getBlogItemMoreURL()
        getBlogItemMoreURL = "detail.asp?blog_id=<"&"%=blogObj.blogId%"&">&content_id=<"&"%=blogItem.itemId%"&"><"&"% if blogCatObj.catId<>"""" then response.write ""&cat_id="" & blogCatObj.catId end if %"&"><"&"% if pageNo<>1 then response.write ""&pageno="" & pageNo end if %"&">#more"
    end function

    function getBlogItemMoreDetail()
        getBlogItemMoreDetail = "<"&"%=blogItem.more%"&">"
    end function

    function getBlogItemMoreEnd()
        getBlogItemMoreEnd = ""&_
        "<"&"%                      " & vbCrLf &_
        "            end if    " & vbCrLf &_
        "%"&">"
    end function
    
    
    function getBloggerEnd()
        getBloggerEnd = "" &_
            "<"&"%                                                  " & vbCrLf &_      
            "        else                                           " & vbCrLf &_
            "          'response.write ""一篇隐藏文章""               " & vbCrLf &_
            "        end if ' end of if blogItem.isSecret           " & vbCrLf &_
            "        'response.flush                                 " & vbCrLf &_
            "      end if ' end of if not isEmpty(blogItem.itemId)  " & vbCrLf &_       
            "    next                                               " & vbCrLf &_
            "    end if ' end of if count<1                         " & vbCrLf &_
            "  end if ' end of if not isArray(blogItems)            " & vbCrLf &_
            "%"&"> " 
    end function
    
    
    function getBlogPageLink()
        getBlogPageLink = "" &_
            "<" & "%"                                 & vbCrLf &_
            "  if blogCatObj.totalItemCount>0 then "  & vbCrLf &_
			"    dim link_url					   "  & vbCrLf &_	
			"    link_url = ""index.asp?blog_id="" & blogObj.blogId 				" & vbCrLf &_
			"    if not isEmpty(blogCatObj.catId) and blogCatObj.catId<>"""" then	" & vbCrLf &_
			"    	link_url = link_url & ""&cat_id="" & blogCatObj.catId			" & vbCrLf &_
			"    end if																" & vbCrLf &_
            "    response.write(getPageLink(blogCatObj.totalPageCount, pageNo, blogCatObj.pageSize, blogCatObj.totalItemCount, link_url , ""pageno""))" & vbCrLf &_
            "  end if    "              & vbCrLf &_
            "%" & ">"  
    end function
    
    
    function getBlogNewItemsStart()
        getBlogNewItemsStart = "" &_
          "<"&"%                                                                        " & vbCrLf &_
          "        topItems = blogObj.getTopItems()                                     " & vbCrLf &_
          "        if  isArray(topItems) then                                           " & vbCrLf &_
          "          count = ubound(topItems)                                           " & vbCrLf &_ 
          "          if count>0 then                                                    " & vbCrLf &_
          "              for i=0 to count-1                                             " & vbCrLf &_
          "                set item = topItems(i)                                       " & vbCrLf &_ 
          "                if userRightObj.canReadItem(item) then                       " & vbCrLf &_ 
          "                    title_trim = """" & item.title                           " & vbCrLf &_     
          "                    if strlen(title_trim)>24 then                               " & vbCrLf &_ 
          "                        title_trim = strleft(title_trim,22) & ""..""            " & vbCrLf &_ 
          "                    end if                                                   " & vbCrLf &_
          "                    user_name_trim = """" & item.userName                    " & vbCrLf &_
          "                    if strlen(user_name_trim)>24 then                           " & vbCrLf &_
          "                        user_name_trim = strleft(user_name_trim,22) & ""..""    " & vbCrLf &_
          "                    end if                                                   " & vbCrLf &_
          "%"&">"
    end function
    

    function getBlogNewItemTitle()
        getBlogNewItemTitle = "<"&"%=title_trim%"&">"
    end function
    
    function getBlogNewItemURL()
        getBlogNewItemURL = "detail.asp?blog_id=<"&"%=item.blogId%"&">&content_id=<"&"%=item.itemId%"&">"
    end function
    
    function getBlogNewItemAuthor()
        getBlogNewItemAuthor = "<"&"%=user_name_trim%"&">"
    end function
    
    function getBlogNewItemDate()
        getBlogNewItemDate = "<"&"%=FORMATDATETIME(item.insertTime,vbShortDate)%"&">"
    end function
    
    function getBlogNewItemsEnd()
        getBlogNewItemsEnd = "" &_
            "<"&"%                  " & vbCrLf &_
            "            end if     " & vbCrLf &_
            "          next         " & vbCrLf &_
            "        end if         " & vbCrLf &_
            "      end if           " & vbCrLf &_
            "%"&">"
    end function
    
    
    function getBlogNewCommentsStart()
        getBlogNewCommentsStart = "" &_
          "<"&"%                                                                             " & vbCrLf &_
          "      topComments = blogObj.getTopComments()                                      " & vbCrLf &_
          "      if  isArray(topComments) then                                               " & vbCrLf &_
          "        count = ubound(topComments)                                               " & vbCrLf &_ 
          "        if count>0 then                                                           " & vbCrLf &_
          "          for i=0 to count-1                                                      " & vbCrLf &_
          "              set comment = topComments(i)                                        " & vbCrLf &_ 
          "              if  userRightObj.canReadComment(comment) then                             " & vbCrLf &_ 
          "                   title_trim = """" & HTML2TXT(comment.detail)                              " & vbCrLf &_     
          "                   if strlen(title_trim)>24 then                                     " & vbCrLf &_ 
          "                      title_trim = strleft(title_trim,22)                   " & vbCrLf &_ 
          "                   end if                                                         " & vbCrLf &_
          "                   user_name_trim = comment.userName                              " & vbCrLf &_
          "                   if strlen(user_name_trim)>24 then                                 " & vbCrLf &_
          "                      user_name_trim = strleft(user_name_trim,22)            " & vbCrLf &_
          "                   end if                                                         " & vbCrLf &_
          "%"&">"
    end function
    
    function getBlogNewCommentTitle()
        getBlogNewCommentTitle = "<"&"%=title_trim%"&">"
    end function
    
    function getBlogNewCommentURL()
        getBlogNewCommentURL = "detail.asp?blog_id=<"&"%=comment.blogId%"&">&content_id=<"&"%=comment.itemId%"&">#comment<"&"%=comment.commentId%"&">"
    end function
    
    function getBlogNewCommentAuthor()
        getBlogNewCommentAuthor = "<"&"%=user_name_trim%"&">"
    end function
    
    function getBlogNewCommentTime()
        getBlogNewCommentTime = "<"&"%=FORMATDATETIME(comment.insertTime,vbShortTime)%"&">"
    end function
    
    function getBlogNewCommentsEnd()
        getBlogNewCommentsEnd = "" &_
            "<"&"%                  " & vbCrLf &_
            "            end if     " & vbCrLf &_
            "          next         " & vbCrLf &_
            "        end if         " & vbCrLf &_
            "      end if           " & vbCrLf &_
            "%"&">"
    end function
    
    
    function getBlogCategoriesStart()
        getBlogCategoriesStart = ""&_
            "<"&"%                                                                                                          " & vbCrLf &_
            "      blogCats = blogObj.getBlogCats()   " & vbCrLf &_
            "      if  isArray(blogCats) then         " & vbCrLf &_
            "        count = ubound(blogCats)         " & vbCrLf &_
            "        if count>0 then                  " & vbCrLf &_
            "           for i=0 to count-1            " & vbCrLf &_
            "               set blogCat = blogCats(i) " & vbCrLf &_
            "%"&">"
    end function
    
    function getBlogCategoryName()
        getBlogCategoryName = "<"&"%=blogCat.catName%"&">"
    end function    
    
    function getBlogCategoryURL()
        getBlogCategoryURL = "index.asp?blog_id=<"&"%=blogCat.blogId%"&">&cat_id=<"&"%=blogCat.catId%"&">"
    end function    

    function getBlogCategoriesEnd()
        getBlogCategoriesEnd = "" &_
            "<"&"%                            " & vbCrLf &_
            "           next                  " & vbCrLf &_
            "        end if                   " & vbCrLf &_
            "      end if                     " & vbCrLf &_
            "%"&">"
    end function
    

    function getMLBlogsStart()
      getMLBlogsStart = ""&_
        "<"&"%                                                                    " & vbCrLf &_                                                 
        "   set mlHost = new MLHostClass   " & vbCrLf &_
        "   mlHost.load()                  " & vbCrLf &_
        "   hostedBlogs = mlHost.getNearsetBlogs(blogObj.blogId)" & vbCrLf &_
        "   if isArray(hostedBlogs) then   " & vbCrLf &_
        "       count = ubound(hostedBlogs)" & vbCrLf &_
        "       if count>0 then            " & vbCrLf &_
        "            for i=0 to count-1    " & vbCrLf &_
        "%"&">"
    end function

    function getMLBlogTitle()
        getMLBlogTitle = "<"&"%=hostedBlogs(i).blogTitle%"&">"
    end function

    function getMLBlogURL()
        getMLBlogURL = "index.asp?blog_id=<"&"%=hostedBlogs(i).blogId%"&">"
    end function

    function getMLBlogsEnd()
      getMLBlogsEnd = "" &_
        "<"&"%                  " & vbCrLf &_
        "            next  " & vbCrLf &_
        "        end if    " & vbCrLf &_
        "    end if        " & vbCrLf &_
        "%"&">"
    end function
    
    function getBlogLinkGroupsStart()
      getBlogLinkGroupsStart = ""&_
        "<"&"%                                                                                                                      " & vbCrLf &_
        "    linkGroups = blogObj.getLinkGroups()  " & vbCrLf &_
        "    if isArray(linkGroups) then           " & vbCrLf &_
        "        count = ubound(linkGroups)        " & vbCrLf &_
        "        if count>0 then                   " & vbCrLf &_
        "          for i=0 to count-1              " & vbCrLf &_
        "            set linkGroup = linkGroups(i) " & vbCrLf &_
        "%"&">"
    end function
    
    function getBlogLinkGroupName()
        getBlogLinkGroupName = "<"&"%=linkGroup.groupName%"&">"
    end function
    
    function getBlogLinksStart()
      getBlogLinksStart = "" &_
        "<"&"%                                                                                                                                                                                                      " & vbCrLf &_
        "            links = linkGroup.links                 " & vbCrLf &_
        "            if isArray(links) then                  " & vbCrLf &_
        "                linkCount = ubound(links)           " & vbCrLf &_
        "                if linkCount>0 then                 " & vbCrLf &_
        "                    for linkIndex=0 to linkCount-1  " & vbCrLf &_
        "                        set link = links(linkIndex) " & vbCrLf &_
        "%"&">"
    end function
    
    function getBlogLinkName()
      getBlogLinkName = ""&_
        "<"&"%                                                                                " & vbCrLf &_                 
        "                    if link.linkImg<>"""" then                                       " & vbCrLf &_
        "                        response.write ""<img border=0 src="" & link.linkImg &"" >"" " & vbCrLf &_
        "                    else                                                             " & vbCrLf &_
        "                        response.write link.linkName                                 " & vbCrLf &_
        "                    end if                                                           " & vbCrLf &_
        "%"&">"
    end function
    
    function getBlogLinkURL()
        getBlogLinkURL = "<"&"%=link.linkUrl%"&">"
    end function
    
    function getBlogLinkDesc()
        getBlogLinkDesc = "<"&"%=link.linkDesc%"&">"
    end function

    function getBlogLinksEnd()
      getBlogLinksEnd = "" &_
        "<%                         " & vbCrLf &_
        "                  next     " & vbCrLf &_
        "                end if     " & vbCrLf &_
        "            end if         " & vbCrLf &_
        "%"&">"
    end function

    function getBlogLinkGroupsEnd()
      getBlogLinkGroupsEnd = "" &_
        "<"&"%               " & vbCrLf &_
        "           next     " & vbCrLf &_
        "         end if     " & vbCrLf &_
        "     end if         " & vbCrLf &_
        "%"&">"
    end function
    
    
    function getBlogArchiveURL()
        getBlogArchiveURL = ""
    end function
        
    function getBlogArchiveName()
        getBlogArchiveName = ""
    end function

    function getBloggerArchivesStart()
        getBloggerArchivesStart = ""
    end function

    function getBloggerArchivesEnd()
        getBloggerArchivesEnd = ""
    end function

    function getMLRSSURL()
        getMLRSSURL = "rss.asp" 
    end function
    
    function getBlogConfigStart()
        getBlogConfigStart = "<" & "% if (userRightObj.canManage) then %" & ">"
    end function
    
    function getBlogConfigURL()
        getBlogConfigURL = "admin/basic.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&pageno=<"&"%=pageNo%"&">"
    end function
    
    function getBlogConfigEnd()
        getBlogConfigEnd = "<" & "% end if %" & ">"
    end function

    function getMLUserIfLoginStart()
        getMLUserIfLoginStart = "<"&"% if (userObj.isFound) then %"&">"
    end function
    
    function getMLUserName()
        getMLUserName = "<"&"%=userObj.userName%"&"><"&"% if userObj.userName<>"""" and userObj.userId="""" then response.write("" [未登录]"") end if %"&">"
    end function
    
    function getMLUserConfigURL()
        getMLUserConfigURL = "userinfo.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&pageno=<"&"%=pageNo%"&">"
    end function
        
    function getMLLogoutURL()
        getMLLogoutURL = "logout.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">"
    end function

    function getMLUserIfLoginEnd()
        getMLUserIfLoginEnd = "<"&"% end if %"&">"
    end function
    
    function getMLUserIfLogoutStart()
        getMLUserIfLogoutStart = "<"&"% if not (userObj.isFound) then %"&">"
    end function
    
    
    function getMLRegisterURL()
        getMLRegisterURL = "register.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">&pageno=<"&"%=pageNo%"&">"
    end function
    
    function getMLLoginURL()
        getMLLoginURL = "login.asp?blog_id=<"&"%=blogObj.blogId%"&">&cat_id=<"&"%=blogCatObj.catId%"&">"
    end function

    function getMLUserIfLogoutEnd()
        getMLUserIfLogoutEnd = "<"&"% end if %"&">"
    end function
    
    
    function getM6Version()
        getM6Version = "<"&"%=MISSLOG_VERSION%"&">"
    end function
    
    
    
    
    
    
    function getBlogDetailStart()
        getBlogDetailStart = "" &_
            "  <script language=javascript>                                       " & vbCrLf &_
            "      var isIE = false                                               " & vbCrLf &_
            "      if (document.all){                                             " & vbCrLf &_
            "          isIE = true;                                               " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "                                                                     " & vbCrLf &_
            "      function RTELoaded(editor){                                    " & vbCrLf &_
            "          if (editor==commentEditor){                                " & vbCrLf &_
            "              if (form1.detail.value!=""""){                         " & vbCrLf &_
            "                  editor.setHTML(form1.detail.value);                " & vbCrLf &_
            "              }                                                      " & vbCrLf &_
            "          }                                                          " & vbCrLf &_
            "                                                                     " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "      function replyComment(comment_id){                             " & vbCrLf &_
            "          theform = document.getElementById(""form1"");              " & vbCrLf &_
            "          theform.action=""comment.asp""                             " & vbCrLf &_
            "          theform.actionType.value="""";                             " & vbCrLf &_
            "          theform.parent_id.value=comment_id;                        " & vbCrLf &_
            "          theform.submit();                                          " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "      function editComment(comment_id){                              " & vbCrLf &_
            "          theform = document.getElementById(""form1"");              " & vbCrLf &_
            "          theform.action=""comment.asp""                             " & vbCrLf &_
            "          theform.actionType.value="""";                             " & vbCrLf &_
            "          theform.comment_id.value=comment_id;                       " & vbCrLf &_
            "          theform.submit();                                          " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "      function deleteComment(comment_id){                            " & vbCrLf &_
            "          if (!confirm(""确定删除吗？"")){                           " & vbCrLf &_
            "              return false;                                          " & vbCrLf &_
            "          }                                                          " & vbCrLf &_
            "          theform = document.getElementById(""form1"");              " & vbCrLf &_
            "          theform.actionType.value=""doDelete"";                     " & vbCrLf &_
            "          theform.comment_id.value=comment_id;                       " & vbCrLf &_
            "          theform.submit();                                          " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "      function saveReply(){                                          " & vbCrLf &_
            "          theform = document.getElementById(""form1"");              " & vbCrLf &_
            "          if (isIE){                                                 " & vbCrLf &_
            "              if(commentEditor.getText()!=""""){                     " & vbCrLf &_
            "                  theform.detail.value = commentEditor.getHTML();    " & vbCrLf &_
            "              }else{                                                 " & vbCrLf &_
            "                  theform.detail.value = """";                       " & vbCrLf &_
            "              }                                                      " & vbCrLf &_
            "          }                                                          " & vbCrLf &_
            "          if (theform.detail.value==""""){                           " & vbCrLf &_
            "              alert(""请输入回复内容"")                              " & vbCrLf &_
            "              return;                                                " & vbCrLf &_
            "          }                                                          " & vbCrLf &_
            "          theform.actionType.value=""doSave"";                       " & vbCrLf &_
            "          theform.submit();                                          " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "      function saveTrack(){                                          " & vbCrLf &_
            "          theform = document.getElementById(""form2"");              " & vbCrLf &_
            "          if (theform.url.value==""""){                              " & vbCrLf &_
            "              alert(""请输入文章URL"")                               " & vbCrLf &_
            "              return;                                                " & vbCrLf &_
            "          }                                                          " & vbCrLf &_
            "          theform.actionType.value=""doSave"";                       " & vbCrLf &_
            "          theform.submit();                                          " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "      function deleteTrack(track_id){                                " & vbCrLf &_
            "          if (!confirm(""确定删除吗？"")){                           " & vbCrLf &_
            "              return false;                                          " & vbCrLf &_
            "          }                                                          " & vbCrLf &_
            "          theform = document.getElementById(""form2"");              " & vbCrLf &_
            "          theform.actionType.value=""doDelete"";                     " & vbCrLf &_
            "          theform.track_id.value=track_id;                           " & vbCrLf &_
            "          theform.submit();                                          " & vbCrLf &_
            "      }                                                              " & vbCrLf &_
            "  </script>                                                          " & vbCrLf &_
            "  <style type=""text/css"">                                          " & vbCrLf &_
            "                                                                     " & vbCrLf &_
            "  BUTTON {                                                           " & vbCrLf &_
            "  	border:1px dotted #999999;background-color:#ffffff;             " & vbCrLf &_
            "  	font-family:verdana;font-size:9pt;height:18px;   " & vbCrLf &_
            "  }                                                                  " & vbCrLf &_
            "                                                                     " & vbCrLf &_
            "  </style>                                                           " & vbCrLf &_
             "<" & "% "  &_
            " if  blogItem.title="" and blogItem.detail="" then    " & vbCrLf &_
            "   message(""文章不存在"")                     " & vbCrLf &_
            "   call closeDB()                              " & vbCrLf &_
            "   response.end                                " & vbCrLf &_
            " end if                                        " & vbCrLf &_          
            " if false then                                 " & vbCrLf &_          
            "%" & ">                                        " & vbCrLf &_
            ""
    end function    
    
        
    
    
    
    function getBlogDetailEnd()
        getBlogDetailEnd = "" &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "  end if                                                                                                                                                                                                                                                                                             " & vbCrLf &_
          "      start_date_str = FORMATDATETIME(blogItem.startDate, vbShortDate)                                                                                                                                                                                                                               " & vbCrLf &_
          "      end_date_str = FORMATDATETIME(blogItem.endDate, vbShortDate)                                                                                                                                                                                                                                   " & vbCrLf &_
          "      insert_time_str = FORMATDATETIME(blogItem.insertTime, vbShortDate)                                                                                                                                                                                                                             " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "  <div style=""padding-left:15px"">                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "     <div style=""float:right"">                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          <a href=""detail.asp?blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&content_id=<" & "%=content_id%" & ">&pageno=<" & "%=request(""pageno"")%" & ">&lang=default"">默认</a>                                                                                   " & vbCrLf &_         
          "          <a href=""detail.asp?blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&content_id=<" & "%=content_id%" & ">&pageno=<" & "%=request(""pageno"")%" & ">&lang=zh_CN"">简体</a>                                                                                     " & vbCrLf &_         
          "          <a href=""detail.asp?blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&content_id=<" & "%=content_id%" & ">&pageno=<" & "%=request(""pageno"")%" & ">&lang=zh_TW"">繁體</a>                                                                                     " & vbCrLf &_         
          "     </div>                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "     <div style=""font-size: 10pt;font-weight: bold;margin-bottom: 10px;"">                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      if start_date_str = insert_time_str and end_date_str = insert_time_str then                                                                                                                                                                                                                    " & vbCrLf &_
          "          response.write (insert_time_str)                                                                                                                                                                                                                                                           " & vbCrLf &_
          "      elseif  start_date_str =  end_date_str then                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          response.write (end_date_str)                                                                                                                                                                                                                                                              " & vbCrLf &_
          "      else                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "          response.write (start_date_str & "" ~ "" & end_date_str)                                                                                                                                                                                                                                   " & vbCrLf &_
          "      end if                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "      <div  style=""font-size: 11pt;font-weight: bold;margin-bottom: 10px;""><" & "%=blogItem.title%" & "></div>                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      <div>                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      if not isNull(blogItem.face) and not isEmpty(blogItem.face) and blogItem.face<>"""" then                                                                                                                                                                                                       " & vbCrLf &_
          "          response.write(""<img src='"" & blogItem.face & ""'  style='float:left;padding-right:10px;padding-bottom:10px' onerror='this.width=0;height=0;this.style.display=""""block""""' "" &_                                                                                                      " & vbCrLf &_
          "                         "" onload='if (this.height>60){this.width=this.width*60/this.height;this.height=60;} '>"")                                                                                                                                                                                  " & vbCrLf &_
          "      end if                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      if blogItem.isSecret then                                                                                                                                                                                                                                                                      " & vbCrLf &_
          "          response.write(""<p>--保密内容--</p>"")                                                                                                                                                                                                                                                    " & vbCrLf &_
          "      end if                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      if userRightObj.canReadItem(blogItem) then                                                                                                                                                                       " & vbCrLf &_
          "          response.write(""<p>""& blogItem.excerpt & ""</p>"")                                                                                                                                                                                                                                       " & vbCrLf &_
          "          response.write(blogItem.detail)                                                                                                                                                                                                                                                            " & vbCrLf &_
          "          if not isNull(blogItem.more) and not isEmpty(blogItem.more) then                                                                                                                                                                                                                           " & vbCrLf &_
          "              response.write(""<a name=more></a><br>"")                                                                                                                                                                                                                                              " & vbCrLf &_
          "              response.write(blogItem.more)                                                                                                                                                                                                                                                          " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      end if                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      <div style=""color: #999999;font-size: 10pt;text-align: right;margin-top: 5px;margin-bottom: 5px;line-height: normal;"">                                                                                                                                                                       " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              if blogItem.userId="""" or blogItem.userId=0 then                                                                                                                                                                                                                                      " & vbCrLf &_
          "                  response.write blogItem.userName                                                                                                                                                                                                                                                   " & vbCrLf &_
          "               else                                                                                                                                                                                                                                                                                  " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "               <a href=user.asp?user_id=<" & "%=blogItem.userId%" & ">&blog_id=<" & "%=blogItem.blogId%" & ">&cat_id=<" & "%=blogItem.catId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">><" & "%= blogItem.userName%" & "></a>                                                                   " & vbCrLf &_                   
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "               end if                                                                                                                                                                                                                                                                                " & vbCrLf &_
          "          %" & ">&nbsp;                                                                                                                                                                                                                                                                              " & vbCrLf &_
          "        <" & "%                                                                                                                                                                                                                                                                                      " & vbCrLf &_
          "          if start_date_str = insert_time_str and end_date_str = insert_time_str then                                                                                                                                                                                                                " & vbCrLf &_
          "              response.write FORMATDATETIME(blogItem.insertTime,vbLongTime)                                                                                                                                                                                                                          " & vbCrLf &_
          "          else                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "              response.write blogItem.insertTime                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "        %" & ">&nbsp;                                                                                                                                                                                                                                                                                " & vbCrLf &_
          "          <" & "% if userRightObj.canEditItem(blogItem) then %" & ">                                                                                                                                                                               " & vbCrLf &_
          "              | <a href=edit.asp?blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&content_id=<" & "%=blogItem.itemId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">> 编辑</a>                                                                                          " & vbCrLf &_         
          "          <" & "% end if  %" & ">                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          <" & "% if userRightObj.canDeleteItem(blogItem)  then %" & ">                                                                                                                                                                               " & vbCrLf &_
          "              | <a href=""#"" onclick=""javascript:if (confirm('确认删除吗？')){document.location.href='delete.asp?blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&content_id=<" & "%=blogItem.itemId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">';}"" >删除</a>   " & vbCrLf &_         
          "          <" & "% end if  %" & ">                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          <" & "% if userRightObj.canReplyItem(blogItem)  then %" & ">| <a href=""#reply"" >回复</a><" & "% end if  %" & ">                                                                                                                           " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      <!--div style=""width:100%;border:1px dotted #cccccc;padding: 10px,10px,10px,10px;"">                                                                                                                                                                                          " & vbCrLf &_
          "           本文引用通告(trackback)URL：<input type=text style=""border:0;background:#F6F6F6"" readonly size=45 onmouseover=""this.focus()"" onfocus=""this.select()""  onclick=""this.select()"" value=""<" & "%=baseURL%" & ">/tb.asp?cid=<" & "%=content_id%" & ">"">      " & vbCrLf &_
          "      </div-->                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      <!--hr /-->                                                                                                                                                                                                                   " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      <div>                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "      <a name=""tracks""></a>                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "        dim track, tracks                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "        tracks = blogItem.getTracks()                                                                                                                                                                                                                                                                " & vbCrLf &_
          "        if isArray(tracks) then                                                                                                                                                                                                                                                                      " & vbCrLf &_
          "          count = ubound(tracks)                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          if count>0 then                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "              for i=0 to count-1                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "                  set track = tracks(i)                                                                                                                                                                                                                                                              " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      <hr  style='height:1px;border-top:0px;border-bottom:1px dashed #cccccc;' />                                                                                                                                                                                                                   " & vbCrLf &_
          "      <a name=""track<" & "%=track.trackId%" & ">""></a>                                                                                                                                                                                                                                             " & vbCrLf &_
          "      <div  style=""font-size: 10pt;font-weight: bold;margin-bottom: 10px;""><" & "%=FORMATDATETIME(track.insertTime,vbShortDate)%" & "> </div>                                                                                                                                                                                                          " & vbCrLf &_
          "      <div><b>引用：</b><a href=<" & "%=track.url%" & ">><" & "%=track.title%" & "></a></div>                                                                                                                                                                                                                                                        " & vbCrLf &_
          "      <div><" & "%=track.excerpt%" & "></div>                                                                                                                                                                                                                                                        " & vbCrLf &_
          "      <div style=""color: #999999;font-size: 10pt;text-align: right;margin-top: 5px;margin-bottom: 5px;line-height: normal;"">                                                                                                                                                                       " & vbCrLf &_
          "          发布在 <a href=<" & "%=track.hostUrl%" & ">><" & "%=track.hostName%" & "></a>                                                                                                                                                                                                              " & vbCrLf &_
          "          <" & "%=FORMATDATETIME(track.insertTime,vbShortTime)%" & ">                                                                                                                                                                                                                                                           " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              if userRightObj.canDelete or (userObj.userId<>"""" and userObj.userId=track.userId) then                                                                                                                                                                                               " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          <!-- a href=""#track<" & "%=track.trackId%" & ">"" onclick=""javascript:deleteTrack(<" & "%=track.trackId%" & ">)"">Delete</a-->                                                                                                                                                           " & vbCrLf &_
          "          <a href=# onclick=""javascript:deleteTrack(<" & "%=track.trackId%" & ">)"" >删除</a>                                                                                                                                                                                                    " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              end if                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "              next                                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "        end if                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                                " & vbCrLf &_
          "       </div>                                                                                                                                                                                                                                                                                               " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "      dim parentComment                                                                                                                                                                                                                                                                              " & vbCrLf &_
          "      set parentComment=new BlogCommentClass                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      parentComment.commentId=Null                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "      parentComment.isSecret=False                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "      const MAX_DEEP_LEN = 2                                                                                                                                                                                                                                                                                               " & vbCrLf &_
          "      dim last_insert_date                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "      call writeComments(blogItem.getComments(),parentComment,0)                                                                                                                                                                                                                                       " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      sub writeComments(comments, parentComment,deepLen)                                                                                                                                                                                                                                                     " & vbCrLf &_
          "        dim comment                                                                                                                                                                                                                                                                                  " & vbCrLf &_
          "        dim insert_date                                                                                                                                                                                                                                                                              " & vbCrLf &_
          "        dim count, i                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "        if isArray(comments) then                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          count = ubound(comments)                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          if count>0 then                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "              for i=0 to count-1                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "                if not isEmpty(comments(i)) then                                                                                                                                                                                                                                                     " & vbCrLf &_
          "                  set  comment =  comments(i)                                                                                                                                                                                                                                                        " & vbCrLf &_
          "                  if comment.parentId=parentComment.commentId or (isNull(comment.parentId) and isNull(parentComment.commentId)) then                                                                                                                                                                 " & vbCrLf &_
          "                    if not isNull(comment.parentId) and deepLen<=MAX_DEEP_LEN  then                                                                                                                                                                                                                                             " & vbCrLf &_
          "                      response.write ""<div  style='margin-left:20px;margin-bottom:10px;background:#f6f6f6;border:1px dotted #cccccc;padding: 10px,10px,10px,10px;'>""                                                                                                                               " & vbCrLf &_
          "					   else																																																																				" & vbCrLf &_
          "						 response.write ""<hr  style='height:1px;border-top:0px;border-bottom:1px dashed #cccccc;'/>""																																													" & vbCrLf &_
          "                    end if                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      <a name=""comment<" & "%=comment.commentId%" & ">"" onclick=""return comment<" & "%=comment.commentId%" & ">_onclick()""></a>                                                                                                                                                                  " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "          insert_date = FORMATDATETIME(comment.insertTime,vbShortDate)                                                                                                                                                                                                                               " & vbCrLf &_
          "          if insert_date<> last_insert_date then                                                                                                                                                                                                                                                     " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      <div  style=""font-size: 10pt;font-weight: bold;margin-bottom: 10px;""><" & "%=insert_date%" & "></div>                                                                                                                                                                                                                                                            " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "              last_insert_date = insert_date                                                                                                                                                                                                                                                         " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      <div>                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "          if not isNull(comment.face) and not isEmpty(comment.face) and comment.face<>"""" then                                                                                                                                                                                                      " & vbCrLf &_
          "              response.write(""<img src='"" & comment.face & ""' style='clear:both;float:left;padding-right:10px;padding-bottom:10px' onerror='this.width=0;height=0;this.style.display=""""block""""' ""&_                                                                                                     " & vbCrLf &_
          "                             "" onload='if (this.height>60){this.width=this.width*60/this.height;this.height=60;} ' >"")                                                                                                                                                                             " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          if comment.isSecret then                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "              response.write(""<p>--悄悄话--</p>"")                                                                                                                                                                                                                                                  " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          if UserRightObj.canReadComment(comment) then                                                                                                                                                                                                                                                     " & vbCrLf &_
          "              response.write(comment.detail)                                                                                                                                                                                                                                                         " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      <div style=""color: #999999;font-size: 10pt;text-align: right;margin-top: 5px;margin-bottom: 5px;line-height: normal;"">                                                                                                                                                                       " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              if comment.userId="""" or comment.userId=0 or isNull(comment.userId) then                                                                                                                                                                                                              " & vbCrLf &_
          "                  response.write comment.userName                                                                                                                                                                                                                                                    " & vbCrLf &_
          "               else                                                                                                                                                                                                                                                                                  " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "               <a href=user.asp?user_id=<" & "%=comment.userId%" & ">&blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">><" & "%=comment.userName%" & "></a>                                                                     " & vbCrLf &_                   
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "               end if                                                                                                                                                                                                                                                                                " & vbCrLf &_
          "          %" & ">&nbsp;                                                                                                                                                                                                                                                                              " & vbCrLf &_
          "          <" & "%=""<a href=mailto:"" & encodemail(comment.email) & "">Email</a>"" %" & ">&nbsp;                                                                                                                                                                                                     " & vbCrLf &_
          "          <" & "%=""<a href="" & comment.webUrl & "">Web</a>"" %" & ">&nbsp;                                                                                                                                                                                                                         " & vbCrLf &_
          "          <" & "%=FORMATDATETIME(comment.insertTime,vbShortTime)%" & ">                                                                                                                                                                                                                              " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              if  UserRightObj.canReplyComment(comment)  then                                                                                                                                                                 " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          &nbsp;                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          <a href=# onclick=""javascript:replyComment(<" & "%=comment.commentId%" & ">)"" >回复</a>                                                                                                                                                                                               " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              end if                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              if (userObj.userId<>"""" and userObj.userId=comment.userId) then                                                                                                                                                                                                                       " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          &nbsp;                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          <a href=#  onclick=""javascript:editComment(<" & "%=comment.commentId%" & ">)"" >编辑</a>                                                                                                                                                                                                " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              end if                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              if userRightObj.canDeleteComment(comment) then                                                                                                                                                                                             " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "          <!--a href=""#comment<" & "%=comment.commentId%" & ">"" onclick=""javascript:deleteComment(<" & "%=comment.commentId%" & ">)"">Delete</a-->                                                                                                                                                " & vbCrLf &_
          "          &nbsp;                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "          <a href=#  onclick=""javascript:deleteComment(<" & "%=comment.commentId%" & ">)"" >删除</a>                                                                                                                                                                                              " & vbCrLf &_
          "          <" & "%                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              end if                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "          %" & ">                                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "        set comments(i) = nothing                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "        comments(i) = Empty                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "        call writeComments(comments, comment, deepLen+1)                                                                                                                                                                                                                                                        " & vbCrLf &_
          "        if not isNull(comment.parentId) and deepLen<=MAX_DEEP_LEN then                                                                                                                                                                                                                                                         " & vbCrLf &_
          "          response.write ""</div>""                                                                                                                                                                                                                                                                  " & vbCrLf &_
          "        end if                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "  <" & "%                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "              end if                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "            end if                                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "          next                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "      end if                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "    end if                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "  end sub                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "  if userRightObj.canReplyItem(blogItem) then                                                                                                                                            " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "  %" & ">                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "      <div>                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "      <a name=""reply""></a>                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      <br>                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "      <form name=""form1"" id=""form1"" method=""post"" action=""reply.asp"">                                                                                                                                                                                                                        " & vbCrLf &_
          "        <input name=""actionType"" type=""hidden""  />                                                                                                                                                                                                                                               " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "        <input name=""blog_id"" type=""hidden"" value=""<" & "%=blogObj.blogId%" & ">"" />                                                                                                                                                                                                           " & vbCrLf &_
          "        <input name=""cat_id"" type=""hidden"" value=""<" & "%=blogCatObj.catId%" & ">"" />                                                                                                                                                                                                          " & vbCrLf &_
          "        <input name=""content_id"" type=""hidden"" value=""<" & "%=content_id%" & ">"" />                                                                                                                                                                                                            " & vbCrLf &_
          "          <input name=""parent_id"" type=""hidden"" value="""" />                                                                                                                                                                                                                                    " & vbCrLf &_
          "        <input name=""comment_id"" type=""hidden""  />                                                                                                                                                                                                                                               " & vbCrLf &_
          "        <input name=""pageno"" type=""hidden"" value=""<" & "%=request(""pageno"")%" & ">"" />                                                                                                                                                                                                       " & vbCrLf &_
          "      <p>                                                                                                                                                                                                                                                                                            " & vbCrLf &_
          "        用户名：<" & "%                                                                                                                                                                                                                                                                              " & vbCrLf &_
          "          if userObj.isFound then                                                                                                                                                                                                                                                                    " & vbCrLf &_
          "              response.write ""<a href=userinfo.asp?blog_id="" & blogObj.blogId & ""&cat_id="" & blogCatObj.catId & ""&pageno="" & request(""pageno"") & "">"" & userObj.userName & ""</a>""                                                                                                         " & vbCrLf &_
          "          else                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "      %" & "><input name=""username"" type=""text"" size=""20"" value=""<" & "%=userObj.userName%" & ">"" />                                                                                                                                                                                         " & vbCrLf &_
          "        &nbsp;密码：<input name=""password"" type=""password"" size=""20"" value="""" />（如不登录密码请留空）                                                                                                                                                                                       " & vbCrLf &_
          "        <br />                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "        Email ：<input name=""email""  type=""text"" size=""20"" value=""<" & "%=userObj.email%" & ">"" />                                                                                                                                                                                           " & vbCrLf &_
          "        &nbsp;主页：<input name=""web_url"" type=""text"" size=""20"" value=""<" & "%=userObj.webUrl%" & ">"" />                                                                                                                                                                                     " & vbCrLf &_
         "         <br />&nbsp;请输入校验码：<input name=""check_num"" type=""text"" size=""5""  /> 校验码：<img src=""check_num.asp"">                                                                                                                                                                           " & vbCrLf &_
          "      <" & "%                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      %" & ">                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "      </p>                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "        您的回复：<br />                                                                                                                                                                                                                                                                             " & vbCrLf &_
          "      <script language=""javascript"">                                                                                                                                                                                                                                                               " & vbCrLf &_
          "          document.write('<textarea name=detail rows=12 cols=38');                                                                                                                                                                                                                                   " & vbCrLf &_
          "          if (isIE){                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "              document.write (' style=""display:none"" ');                                                                                                                                                                                                                                           " & vbCrLf &_
          "          }                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "          document.write('>');                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "      </script></textarea>                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "      <script language=""javascript"">                                                                                                                                                                                                                                                               " & vbCrLf &_
          "          if (isIE){                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          "              document.write('<IFRAME id=""commentEditor"" Name=""commentEditor"" style=""WIDTH: 90%; HEIGHT: 360px""  SRC=""rte/rte.htm""></IFRAME>');                                                                                                                                            " & vbCrLf &_
          "              document.write('<input type=hidden name=""use_rte"" value=""true"">');                                                                                                                                                                                                                 " & vbCrLf &_
          "          }                                                                                                                                                                                                                                                                                          " & vbCrLf &_
          "      </script>                                                                                                                                                                                                                                                                                      " & vbCrLf &_
          "                                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "            <br />                                                                                                                                                                                                                                                                                   " & vbCrLf &_
          "       <" & "% if userObj.userId<>"""" then %" & "> <input name=""is_secret"" type=""checkbox"" value=""true""  <" & "% if blogItem.isSecret then response.write(""checked"") end if %" & ">   >悄悄话</input>   <" & "% end if %" & ">                                                               " & vbCrLf &_
          "        <br />                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "        <br />                                                                                                                                                                                                                                                                                       " & vbCrLf &_
          "        <input name=""submitBtn"" type=""button"" onclick=""saveReply()"" value=""&nbsp;&nbsp;回 复&nbsp;&nbsp;""  />                                                                                                                                                                                " & vbCrLf &_
          "        <input  type=""button"" onclick=""history.back()"" value=""&nbsp;&nbsp;后 退&nbsp;&nbsp;""  />                                                                                                                                                                                               " & vbCrLf &_
          "        <input  type=""button"" onclick=""document.location.href='index.asp?blog_id=<" & "%=blogObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">'""                                                                                                " & vbCrLf &_
          "                 value=""&nbsp;&nbsp;返 回&nbsp;&nbsp;""  />                                                                                                                                                                                                                                         " & vbCrLf &_
          "      </form>                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "      </div>                                                                                                                                                                                                                                                                                         " & vbCrLf &_
          "      <" & "%                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "      else                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "      %" & ">                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "      <p align=center>                                                                                                                                                                                                                                                                               " & vbCrLf &_
          "                      <input  type=""button"" onclick=""history.back()"" value=""&nbsp;&nbsp;后 退&nbsp;&nbsp;""  />                                                                                                                                                                                 " & vbCrLf &_
          "                      <input  type=""button"" onclick=""document.location.href='index.asp?blog_id=<" & "%=blogCatObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">'""                                                                               " & vbCrLf &_
          "                              value=""&nbsp;&nbsp;返 回&nbsp;&nbsp;""  />                                                                                                                                                                                                                            " & vbCrLf &_
          "      </p>                                                                                                                                                                                                                                                                                           " & vbCrLf &_
          "      <" & "%                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          "          end if                                                                                                                                                                                                                                                                                     " & vbCrLf &_
          "      %" & ">                                                                                                                                                                                                                                                                                        " & vbCrLf &_
          ""
          REM "  <div><a name=""tracks""></a>                                                                                                                                                                                                                                                        " & vbCrLf &_
          REM "  <" & "% if userRightObj.canReplyItem(blogItem) then %" & ">                                                                                                         " & vbCrLf &_
          REM "                                                                                                                                                                                                                                                                                 " & vbCrLf &_
          REM "              <hr/><a name=""trackback""></a>                                                                                                                                                                                                                                         " & vbCrLf &_
          REM "              <!--p>本文引用通告(trackback)URL：<input type=text style=""border:0"" readonly size=50 onmouseover=""this.focus()"" onfocus=""this.select()"" value=""<" & "%=baseURL%" & ">/tb.asp?cid=<" & "%=content_id%" & ">"">                                                 " & vbCrLf &_
          REM "              本文全文URL：<a href=<" & "%=baseURL%" & ">/detail.asp?blog_id=<" & "%=blogObj.blogId%" & ">&content_id=<" & "%=content_id%" & ">><" & "%=baseURL%" & ">/detail.asp?blog_id=<" & "%=blogObj.blogId%" & ">&content_id=<" & "%=content_id%" & "></a></p-->          " & vbCrLf &_
          REM "              <p>如果您转贴了本文，或者在其他位置发布了相关文章，或者推荐相关文章，<br>请留下该文章的URL及相关信息：</p>                                                                                                                                 " & vbCrLf &_
          REM "              <form name=""form2"" id=""form2"" method=""post"" action=""tracks.asp"">                                                                                                                                                                                           " & vbCrLf &_
          REM "                  <input name=""actionType"" type=""hidden"" value=""doSave"" />                                                                                                                                                                                                 " & vbCrLf &_
          REM "                  <input name=""blog_id"" type=""hidden"" value=""<" & "%=blogObj.blogId%" & ">"" />                                                                                                                                                                             " & vbCrLf &_
          REM "                  <input name=""cat_id"" type=""hidden"" value=""<" & "%=blogCatObj.catId%" & ">"" />                                                                                                                                                                            " & vbCrLf &_
          REM "                  <input name=""content_id"" type=""hidden"" value=""<" & "%=content_id%" & ">"" />                                                                                                                                                                              " & vbCrLf &_
          REM "                  <input name=""track_id"" type=""hidden""  />                                                                                                                                                                                                                   " & vbCrLf &_
          REM "                  <input name=""pageno"" type=""hidden"" value=""<" & "%=request(""pageno"")%" & ">"" />                                                                                                                                                                         " & vbCrLf &_
          REM "                  URL： <br />                                                                                                                                                                                                                                                   " & vbCrLf &_
          REM "                  <input name=""url"" type=""text"" size=""38"" value=""http://"" /> <font color=red>*</font>                                                                                                                                                                    " & vbCrLf &_
          REM "                  <br />                                                                                                                                                                                                                                                         " & vbCrLf &_
          REM "                  文章标题： <br />                                                                                                                                                                                                                                              " & vbCrLf &_
          REM "                  <input name=""title""  type=""text"" size=""38"" /><br />                                                                                                                                                                                                      " & vbCrLf &_
          REM "                  站点URL： <br />                                                                                                                                                                                                                                               " & vbCrLf &_
          REM "                  <input name=""host_url""  type=""text"" size=""38"" />                                                                                                                                                                                                         " & vbCrLf &_
          REM "                  <br />                                                                                                                                                                                                                                                         " & vbCrLf &_
          REM "                  站点名称： <br />                                                                                                                                                                                                                                              " & vbCrLf &_
          REM "                  <input name=""host_name""  type=""text"" size=""38"" /><br />                                                                                                                                                                                                  " & vbCrLf &_
          REM "                  内容摘要：<br />                                                                                                                                                                                                                                               " & vbCrLf &_
          REM "                  <textarea name=""excerpt"" rows=""10"" cols=""38""></textarea>                                                                                                                                                                                                 " & vbCrLf &_
          REM "                  <br />                                                                                                                                                                                                                                                         " & vbCrLf &_
          REM "                  <br />                                                                                                                                                                                                                                                         " & vbCrLf &_
          REM "                  <input name=""submitBtn"" type=""button"" onclick=""saveTrack()"" value=""&nbsp;&nbsp;提 交&nbsp;&nbsp;""  />                                                                                                                                                  " & vbCrLf &_
          REM "                  <input  type=""button"" onclick=""history.back()"" value=""&nbsp;&nbsp;后 退&nbsp;&nbsp;""  />                                                                                                                                                                 " & vbCrLf &_
          REM "                  <input  type=""button"" onclick=""document.location.href='index.asp?blog_id=<" & "%=blogCatObj.blogId%" & ">&cat_id=<" & "%=blogCatObj.catId%" & ">&pageno=<" & "%=request(""pageno"")%" & ">'"" value=""&nbsp;&nbsp;返 回&nbsp;&nbsp;""  />                   " & vbCrLf &_
          REM "              </form>                                                                                                                                                                                                                                                            " & vbCrLf &_
          REM "              </div>                                                                                                                                                                                                                                                             " & vbCrLf &_
          REM "  <" & "% end if %" & ">                                                                                                                                                                                                                                                         " & vbCrLf &_          
          
          getBlogDetailEnd = getBlogDetailEnd &_
          "   </div><!--end of content-->                                                                                                                                                                                                                                                                                  " & vbCrLf &_
          "   <p>&nbsp;</p>                                                                                                                                                                                                                                                                                  " & vbCrLf &_
          ""    
    
    end function
    

    
    
    
    
    
    
    
    
    
    
    function transTemplet(templateCode, isDetail)
        dim tmp
        tmp = templateCode
        
        '过滤服务器端脚本
        tmp = replace(tmp, "<" & "%", "&lt;%")
        tmp = replace(tmp, "%" & ">", "%&gt;")
        tmp = replace(tmp, "<!--" & "#", "<"&"%=""<!--""&""#""%"&">")

        tmp = replace(tmp, "runat", "run at", 1, -1, 1)
        
        '应用标签
        tmp = getFileStart() & tmp & getFileEnd()
        tmp = replace(tmp, "<$BlogTitle$>", getBlogTitle(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogDescription$>", getBlogDescription(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogOwnerFullName$>", getBlogOwnerFullName(), 1, -1, 1)
        
        if isDetail <> true then
            tmp = replace(tmp, "<Blogger>", getBloggerStart(), 1, -1, 1)
        
            tmp = replace(tmp, "<BlogDateHeader>", getBlogDateHeaderStart(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogDateHeaderDate$>", getBlogDateHeaderDate(), 1, -1, 1)
            tmp = replace(tmp, "</BlogDateHeader>", getBlogDateHeaderEnd(), 1, -1, 1)
        
            tmp = replace(tmp, "<BlogItemTitle>", getBlogItemTitleStart(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemTitle$>", getBlogItemTitle(), 1, -1, 1)
            tmp = replace(tmp, "</BlogItemTitle>", getBlogItemTitleEnd(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemBody$>", getBlogItemBody(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemPermalinkURL$>", getBlogItemPermalinkURL(), 1, -1, 1)
        
            tmp = replace(tmp, "<$BlogItemAuthor$>", getBlogItemAuthor(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemAuthorNickname$>", getBlogItemAuthorNickname(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemAuthorEmail$>", getBlogItemAuthorEmail(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemAuthorURL$>", getBlogItemAuthorWebURL(), 1, -1, 1)
        
            tmp = replace(tmp, "<$BlogItemDateTime$>", getBlogItemDateTime(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemNumber$>", getBlogItemNumber(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemArchiveFileName$>", getBlogItemArchiveFileName(), 1, -1, 1)

            tmp = replace(tmp, "</Blogger>", getBloggerEnd(), 1, -1, 1)

            tmp = replace(tmp, "<$BlogPageLink$>", getBlogPageLink(), 1, -1, 1)
        else
            tmp = replace(tmp, "<Blogger>", getBlogDetailStart(), 1, -1, 1)
            tmp = replace(tmp, "<$BlogItemTitle$>", getBlogItemTitle(), 1, -1, 1)
            tmp = replace(tmp, "</Blogger>", getBlogDetailEnd(), 1, -1, 1)

            tmp = replace(tmp, "<$BlogPageLink$>", "", 1, -1, 1)
        end if    
        
        tmp = replace(tmp, "<BloggerArchives>", getBloggerArchivesStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogArchiveName$>", getBlogArchiveName(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogArchiveURL$>", getBlogArchiveURL(), 1, -1, 1)
        tmp = replace(tmp, "</BloggerArchives>", getBloggerArchivesEnd(), 1, -1, 1)
        
        '标签扩展部分
        tmp = replace(tmp, "<$BlogURL$>", getBlogURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogRSSURL$>", getBlogRSSURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogPhotoURL$>", getBlogPhotoURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogOwnerName$>", getBlogOwnerFullName(), 1, -1, 1)

        tmp = replace(tmp, "<BlogConfig>", getBlogConfigStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogConfigURL$>", getBlogConfigURL(), 1, -1, 1)
        tmp = replace(tmp, "</BlogConfig>", getBlogConfigEnd(), 1, -1, 1)

        tmp = replace(tmp, "<BlogPost>", getBlogPostStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogPostURL$>", getBlogPostURL(), 1, -1, 1)
        tmp = replace(tmp, "</BlogPost>", getBlogPostEnd(), 1, -1, 1)
        
        tmp = replace(tmp, "<BlogCurrentCategory>", getBlogCurrentCategoryStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogCurrentCategoryURL$>", getBlogCurrentCategoryURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogCurrentCategoryName$>", getBlogCurrentCategoryName(), 1, -1, 1)
        tmp = replace(tmp, "</BlogCurrentCategory>", getBlogCurrentCategoryEnd(), 1, -1, 1)
        
        tmp = replace(tmp, "<BlogNewItems>", getBlogNewItemsStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewItemURL$>", getBlogNewItemURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewItemTitle$>", getBlogNewItemTitle(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewItemAuthor$>", getBlogNewItemAuthor(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewItemDate$>", getBlogNewItemDate(), 1, -1, 1)
        tmp = replace(tmp, "</BlogNewItems>", getBlogNewItemsEnd(), 1, -1, 1)

        tmp = replace(tmp, "<BlogNewComments>", getBlogNewCommentsStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewCommentURL$>", getBlogNewCommentURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewCommentTitle$>", getBlogNewCommentTitle(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewCommentAuthor$>", getBlogNewCommentAuthor(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogNewCommentTime$>", getBlogNewCommentTime(), 1, -1, 1)
        tmp = replace(tmp, "</BlogNewComments>", getBlogNewCommentsEnd(), 1, -1, 1)

        tmp = replace(tmp, "<BlogCategories>", getBlogCategoriesStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogCategoryName$>", getBlogCategoryName(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogCategoryURL$>", getBlogCategoryURL(), 1, -1, 1)
        tmp = replace(tmp, "</BlogCategories>", getBlogCategoriesEnd(), 1, -1, 1)

        tmp = replace(tmp, "<BlogLinkGroups>", getBlogLinkGroupsStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogLinkGroupName$>", getBlogLinkGroupName(), 1, -1, 1)
        tmp = replace(tmp, "<BlogLinks>", getBlogLinksStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogLinkName$>", getBlogLinkName(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogLinkURL$>", getBlogLinkURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogLinkDesc$>", getBlogLinkDesc(), 1, -1, 1)
        tmp = replace(tmp, "</BlogLinks>", getBlogLinksEnd())
        tmp = replace(tmp, "</BlogLinkGroups>", getBlogLinkGroupsEnd(), 1, -1, 1)


        
        tmp = replace(tmp, "<BlogItemShowDetail>", getBlogItemIfShowDetailStart(), 1, -1, 1)
        tmp = replace(tmp, "<BlogItemIfShowDetail>", getBlogItemIfShowDetailStart(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemShowDetail>", getBlogItemIfShowDetailEnd(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemIfShowDetail>", getBlogItemIfShowDetailEnd(), 1, -1, 1)

        tmp = replace(tmp, "<BlogItemHideDetail>", getBlogItemIfHideDetailStart(), 1, -1, 1)
        tmp = replace(tmp, "<BlogItemIfHideDetail>", getBlogItemIfHideDetailStart(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemHideDetail>", getBlogItemIfHideDetailEnd(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemIfHideDetail>", getBlogItemIfHideDetailEnd(), 1, -1, 1)

        tmp = replace(tmp, "<BlogItemCategory>", getBlogItemCategoryStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemCategoryURL$>", getBlogItemCategoryURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemCategoryName$>", getBlogItemCategoryName(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemCategory>", getBlogItemCategoryEnd(), 1, -1, 1)

        tmp = replace(tmp, "<$BlogItemLink$>", getBlogItemPermalinkURL(), 1, -1, 1)

        tmp = replace(tmp, "<$BlogItemExcerpt$>", getBlogItemExcerpt(), 1, -1, 1)
        
        
        tmp = replace(tmp, "<BlogItemMore>", getBlogItemMoreStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemMoreURL$>", getBlogItemMoreURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemMoreDetail$>", getBlogItemMoreDetail(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemMore>", getBlogItemMoreEnd(), 1, -1, 1)
        
        tmp = replace(tmp, "<BlogItemEdit>", getBlogItemEditStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemEditURL$>", getBlogItemEditURL(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemEdit>", getBlogItemEditEnd(), 1, -1, 1)
        
        tmp = replace(tmp, "<BlogItemDelete>", getBlogItemDeleteStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemDeleteURL$>", getBlogItemDeleteURL(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemDelete>", getBlogItemDeleteEnd(), 1, -1, 1)
        
        tmp = replace(tmp, "<BlogItemComment>", getBlogItemCommentStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemCommentURL$>", getBlogItemCommentURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemCommentCount$>", getBlogItemCommentCount(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemComment>", getBlogItemCommentEnd(), 1, -1, 1)
        
        tmp = replace(tmp, "<BlogItemTrack>", getBlogItemTrackStart(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemTrackURL$>", getBlogItemTrackURL(), 1, -1, 1)
        tmp = replace(tmp, "<$BlogItemTrackCount$>", getBlogItemTrackCount(), 1, -1, 1)
        tmp = replace(tmp, "</BlogItemTrack>", getBlogItemTrackEnd(), 1, -1, 1)

        tmp = replace(tmp, "<$BlogItemAuthorLink$>", getBlogItemAuthorLink(), 1, -1, 1)
        
        tmp = replace(tmp, "<MLBlogs>", getMLBlogsStart(), 1, -1, 1)
        tmp = replace(tmp, "<$MLBlogTitle$>", getMLBlogTitle(), 1, -1, 1)
        tmp = replace(tmp, "<$MLBlogURL$>", getMLBlogURL(), 1, -1, 1)
        tmp = replace(tmp, "</MLBlogs>", getMLBlogsEnd(), 1, -1, 1)

        tmp = replace(tmp, "<$MLRSSURL$>", getMLRSSURL(), 1, -1, 1)

        tmp = replace(tmp, "<MLUserConfig>", getMLUserIfLoginStart(), 1, -1, 1)
        tmp = replace(tmp, "<MLUserIfLogin>", getMLUserIfLoginStart(), 1, -1, 1)
        tmp = replace(tmp, "<$MLUserName$>", getMLUserName(), 1, -1, 1)
        tmp = replace(tmp, "<$MLUserConfigURL$>", getMLUserConfigURL(), 1, -1, 1)
        tmp = replace(tmp, "<$MLLogoutURL$>", getMLLogoutURL(), 1, -1, 1)
        tmp = replace(tmp, "</MLUserConfig>", getMLUserIfLoginEnd(), 1, -1, 1)
        tmp = replace(tmp, "</MLUserIfLogin>", getMLUserIfLoginEnd(), 1, -1, 1)

        tmp = replace(tmp, "<MLUserIfLogout>", getMLUserIfLogoutStart(), 1, -1, 1)
        tmp = replace(tmp, "<$MLRegisterURL$>", getMLRegisterURL(), 1, -1, 1)
        tmp = replace(tmp, "<$MLLoginURL$>", getMLLoginURL(), 1, -1, 1)
        tmp = replace(tmp, "</MLUserIfLogout>", getMLUserIfLogoutEnd(), 1, -1, 1)

        tmp = replace(tmp, "<M6Blogs>", getMLBlogsStart(), 1, -1, 1)
        tmp = replace(tmp, "<$M6BlogTitle$>", getMLBlogTitle(), 1, -1, 1)
        tmp = replace(tmp, "<$M6BlogURL$>", getMLBlogURL(), 1, -1, 1)
        tmp = replace(tmp, "</M6Blogs>", getMLBlogsEnd(), 1, -1, 1)

        tmp = replace(tmp, "<$M6RSSURL$>", getMLRSSURL(), 1, -1, 1)

        tmp = replace(tmp, "<M6UserConfig>", getMLUserIfLoginStart(), 1, -1, 1)
        tmp = replace(tmp, "<M6UserIfLogin>", getMLUserIfLoginStart(), 1, -1, 1)
        tmp = replace(tmp, "<$M6UserName$>", getMLUserName(), 1, -1, 1)
        tmp = replace(tmp, "<$M6UserConfigURL$>", getMLUserConfigURL(), 1, -1, 1)
        tmp = replace(tmp, "<$M6LogoutURL$>", getMLLogoutURL(), 1, -1, 1)
        tmp = replace(tmp, "</M6UserConfig>", getMLUserIfLoginEnd(), 1, -1, 1)
        tmp = replace(tmp, "</M6UserIfLogin>", getMLUserIfLoginEnd(), 1, -1, 1)

        tmp = replace(tmp, "<M6UserIfLogout>", getMLUserIfLogoutStart(), 1, -1, 1)
        tmp = replace(tmp, "<$M6RegisterURL$>", getMLRegisterURL(), 1, -1, 1)
        tmp = replace(tmp, "<$M6LoginURL$>", getMLLoginURL(), 1, -1, 1)
        tmp = replace(tmp, "</M6UserIfLogout>", getMLUserIfLogoutEnd(), 1, -1, 1)

        tmp = replace(tmp, "<$M6Version$>", getM6Version(), 1, -1, 1)


        transTemplet = tmp
    end function
    
    sub applySysTemplet(skinCfgPath)

        
        dim skinData, skinName, fso, file, relativePath, dateLastModified
        skinData = getSysTemplet(template_id)
        skinName = skinData(0)
        
        call createSkinCacheFolders(skinName)
        call createDataFolders

        '获取模板cache文件最后修改时间
        set fso=Server.CreateObject("Scripting.FileSystemObject")
        relativePath =  MISSLOG_ROOT & "/skin_cache/" & skinName & "/index.asp" 
        if  fso.FileExists(Server.MapPath(relativePath)) then
            set file=fso.GetFile(Server.MapPath(relativePath))
            dateLastModified = file.DateLastModified
            set file = nothing
        end if
        set fso = nothing
        
        if  skinData(4) > dateLastModified then '模板有新修改，重新生成缓存
            dim tmp

            tmp = transTemplet(skinData(2), False) ' templet_code for index.asp 
            relativePath =  MISSLOG_ROOT & "/skin_cache/" & skinName & "/index.asp" 
            call writeTextFile(relativePath, tmp, DEFAULT_CHARSET)
            
            tmp = transTemplet(skinData(3), True) ' templet_code for detail.asp 
            relativePath =  MISSLOG_ROOT & "/skin_cache/" & skinName & "/detail.asp" 
            call writeTextFile(relativePath, tmp, DEFAULT_CHARSET)
            
        end if
        
        'blog展示页转向至skin cache
        tmp = "<" & "% "  & vbCrLf &_ 
              " on error resume next "  & vbCrLf &_
              " Server.transfer(""" & MISSLOG_ROOT & "/skin_cache/" & skinName & "/index.asp"")"  & vbCrLf &_
              " if Err.number=0 then " & vbCrLf &_
              "   response.end " & vbCrLf &_
              " else " & vbCrLf &_
              "   on error goto 0"  & vbCrLf &_
              "   Server.transfer(""" & MISSLOG_ROOT & "/data/default/index.asp"")"  & vbCrLf &_
              " end if"  & vbCrLf &_
              " %" & ">"
        relativePath = MISSLOG_ROOT & "/data/" & blogObj.blogId& "/index.asp"
        call writeTextFile(relativePath, tmp, DEFAULT_CHARSET)

        tmp = "<" & "% "  & vbCrLf &_ 
              " on error resume next "  & vbCrLf &_
              " Server.transfer(""" & MISSLOG_ROOT & "/skin_cache/" & skinName & "/detail.asp"")"  & vbCrLf &_
              " if Err.number=0 then " & vbCrLf &_
              "   response.end " & vbCrLf &_
              " else " & vbCrLf &_
              "   on error goto 0"  & vbCrLf &_
              "   Server.transfer(""" & MISSLOG_ROOT & "/data/default/detail.asp"")"  & vbCrLf &_
              " end if"  & vbCrLf &_
              "%" & ">"
        relativePath = MISSLOG_ROOT & "/data/" & blogObj.blogId& "/detail.asp"
        call writeTextFile(relativePath, tmp, DEFAULT_CHARSET)
            
        
    end sub
    


    function applyTemplet(templetCode, fileName, isDetail)
        dim tmp
        tmp = transTemplet(templetCode, isDetail)

        call createDataFolders

        dim relativePath
        relativePath = MISSLOG_ROOT & "/data/" & blogObj.blogId& "/" & fileName
        
        call writeTextFile(relativePath, tmp, DEFAULT_CHARSET)
        

        applyTemplet = relativePath
    end function    
%>